#include <iostream>
#include <stdexcept>
#include "token.h"
#include "parser.h"

int main(void)
{
    Parser * parser = new Parser();

    while (true)
    {
        std::cout << "$> ";

        try
        {
            CommandLine *commandLine = parser->parse();
            commandLine->execute();
            delete commandLine;

        }
        catch (std::runtime_error& e)
        {
            std::cout << e.what() << "\n";
            std::cin.ignore(1000, '\n');
        }
    }

    delete parser;

    return 0;
}
